#include <iostream>
#include <vector>
#include <unordered_map>

using namespace std;

class Solution
{
public:
    vector<int> twoSum(vector<int>& nums, int target) 
    {
        unordered_map<int, int> map;
        for(int i = 0; i < nums.size(); i++)
        {
            int current_num = nums[i];
            int complement = target - current_num;
            if (map.count(complement))
            {
                return{map[complement], i};
            }
            map[current_num] = i;
        }
        return {};
    }
};

int main()
{
    vector<int> nums;
    nums.push_back(3);
    nums.push_back(2);
    nums.push_back(4);

    Solution s;
    vector<int> ans;
    ans = s.twoSum(nums, 6);
    cout << ans[0] << " " << ans[1] << endl;
    return 0;
}